<?php
Yii::app()->clientScript->registerScriptFile($this->staticsPath."/frontend/js/jquery.js",CClientScript::POS_HEAD);
Yii::app()->clientScript->registerCssFile($this->staticsPath."/css/global.css");
Yii::app()->clientScript->registerCssFile($this->staticsPath."/css/index.css");
Yii::app()->clientScript->registerCssFile($this->staticsPath."/css/font-awesome.min.css");
Yii::app()->clientScript->registerCssFile($this->staticsPath."/Font-Awesome-3.2.1/css/font-awesome.min.css");
Yii::app()->clientScript->registerScriptFile($this->staticsPath."/js/alert.js",CClientScript::POS_HEAD);

Yii::app()->clientScript->registerCss("CSS1","
    .cont_box img{
        height: 200px;
    }

   #loadings {
        left: 50%;
        position: absolute;
        top: 50%;
    }

");


?>
<style type="text/css">
    .main-box {

        height: 100%;
        left: 0;
        margin: 0 auto;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: -1;
    }
    .morcon {
        height: 100px;
        margin: 245px 20px 20px;
        position: relative;
        text-align: center;
    }

    .morcon .reg {
        background: rgba(255, 255, 255, 0) none repeat scroll 0 0;
        border: medium none;
        color: #fff;
        font-size: 20px;
        left: 4%;
        position: absolute;
        top: 0;
    }
    .morcon .login {
        background: rgba(255, 255, 255, 0) none repeat scroll 0 0;
        border: medium none;
        color: #fff;
        display: block;
        font-size: 20px;
        left: 51%;
        position: absolute;
        top: 39%;
    }

    .wrap .header{
        width: 100%;
        position: relative;
        height: 300px;
    }
    .wrap .footer {
        height: 300px;
        position: relative;
        width: 100%;
    }

    .wrap .header .mydodo{
         background: url("<?php echo $this->staticsPath."/img/mydodo.png" ?>") no-repeat scroll 0 0 / 150px auto;
         height: 40px;
         width: 150px;
         position: absolute;
         right: 15px;
         top: 25px;
     }
    .wrap .header .imgbg{
        background: url("<?php echo $this->staticsPath."/img/imgbg.png" ?>") no-repeat scroll 0 0 / 150px auto;
        height: 150px;
        width: 150px;
        position: absolute;
        left: 15px;
        top: 90px;
    }
    .imgbg .box{
        width: 100%;
        height: 100%;
        position: relative;
    }
    .imgbg .box img {
        border-radius: 50%;
        height: 80%;
        left: 15px;
        position: absolute;
        top: 15px;
        width: 80%;
    }
    .wrap .header .hname {
        height: 200px;
        left: 170px;
        position: absolute;
        top: 144px;
        width: 200px;
    }
    .wrap .header .hname p{
        color: #0066b3;
        font-size: 20px;
    }
    .wrap .header .list {


        height: 80px;
        left: 25px;
        position: absolute;
        top: 25px;
        width: 80px;
    }
    .wrap .header .list a{
        color: #0066b3;
        font-size: 30px;
    }
    .wrap .footer .fbotton{
        width: 33%;
        height: 150px;
        float: left;
    }
    .wrap .footer .fbotton .like{
        background: url("<?php echo $this->staticsPath."/img/mylike.png" ?>") no-repeat scroll 13px 0 / 90px auto;
        height: 100%;
        width: 100%;
    }
    .wrap .footer .fbotton .collection{
        background: url("<?php echo $this->staticsPath."/img/mycollection.png" ?>") no-repeat scroll 13px 0 / 104px auto;
        height: 100%;
        width: 100%;
    }
    .wrap .footer .fbotton .share{
        background: url("<?php echo $this->staticsPath."/img/share.png" ?>") no-repeat scroll -2px 15px / 114px auto;
        height: 100%;
        width: 100%;
    }
    .wrap .footer .fbotton .point{
        background: url("<?php echo $this->staticsPath."/img/point.png" ?>") no-repeat scroll 6px 0 / 104px auto;
        height: 100%;
        width: 100%;
    }
    .wrap .footer .fbotton .pointlist{
        background: url("<?php echo $this->staticsPath."/img/pointlist.png" ?>") no-repeat scroll 13px 0 / 90px auto;
        height: 100%;
        width: 100%;
    }
    .wrap .footer .fbotton .pointgift{
        background: url("<?php echo $this->staticsPath."/img/pointgift.png" ?>") no-repeat scroll 13px 11px / 90px auto;
        height: 100%;
        width: 100%;
    }

    body{
        background: #f4f4f4 none repeat scroll 0 0;
    }
    .topban{
        padding: 0 10px
    }
    .topban .top {
        color: #888;
        height: 20px;
        left: 50%;
        line-height: 20px;
        margin: 52px 0 52px -40px;
        position: absolute;
        top: 50%;
    }
    #logout{
        color: #ffffff;
        font-size: 18px;
    }
    #logout:hover{
        color: #ffffff;
    }
    .lgt{

        width: 90%;
        height: 50px;
        text-align: center;
        margin: 20px auto 0 auto;
        margin-bottom: 50px;
        background: rgb(231,66,60);
        border-radius: 8px;
        line-height: 50px;
    }
    .right {
        float: right;
        margin-top: 20px;
    }
    .wrap .fa{
        width: 36px;
    }
    section a {
        color:#999
    }
    .modl_tel {
        background: #ffffff none repeat scroll 0 0;
        border-bottom: 1px solid #ccc;
        height: 60px;
        line-height: 60px;
        margin: 0;
        padding-left: 10px;
    }
    .topban {
        padding: 0 10px;
    }
    .topban {
     	background: #fff none repeat scroll 0 0;
        height: 160px;
        overflow: unset;
        position: relative;
        width: 100%;
    }
    .status-people-pic {
        left: 50%;
        margin-left: -50px;
        margin-top: -50px;
        position: absolute;
        top: 50%;
    }
    .stat-people {
        background: #fafafa none repeat scroll 0 0;
        border-radius: 30em;
        display: block;
        padding: 7px;
        position: relative;
        width: 100px;
    }
    .topban {
        overflow: unset;
        position: relative;
        width: 100%;
    }
    .nav {
        background: rgb(249, 249, 249) none repeat scroll 0 0;
        border-top: 1px solid #ddd;
        bottom: 0;
        opacity: 0.9;
        padding: 6px 0 !important;
        position: fixed;
        width: 100%;
        height: 55px;
    }
    .nav .nav-box {
        color: #333;
        float: left;
        font-size: 14px;
        text-align: center;
        width: 33%;
        height: 100%;
    }
    .nav .nav-box.actt{
        color: #068043;
    }
    #loading {
        font-size: 30px;
        height: 50px;
        margin: 0 auto;
        text-align: center;
        width: 100px;
    }
    .alert-error {
        color: #b94a48;
    }
    .alert {
        border-radius: 4px;
        margin-bottom: 20px;
        padding: 8px;
        text-align: center;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    }
</style>

<div class="data">
    <header class="homeHder header">
        <div class="hder_logo">阅读指导</div>
    </header>
    <section class="wrap">

        <section class="cont_wrpa" id="min">
            <?php if($list){ ?>
            <?php foreach($list as $v){ ?>
            <a href="<?php echo Yii::app()->createUrl('index/newsShow',array('id'=>$v['id'],'openid'=>$openid)) ?>">
                <div class="modl_tel">
                    <?php echo $v['title'] ?>
                    <i class="fa fa-chevron-right right"></i>
                </div>
            </a>
            <?php }} ?>


        </section>
    </section>






</div>



<div id="loading" style="display: none"><i class="fa fa-spinner fa-spin"></i></div>
<div id="alt" style="display: none" class="alert alert-error">
    已经到底啦！
</div>


<script type="text/javascript">
    $(function(){
        var currentPage = 0;
        var isloading = false;
        $(window).scroll(function(){
            if($(window).scrollTop() + 100 >= $(document).height() - $(window).height()){
                if (isloading == true){
                    return false;
                }
                currentPage = currentPage + 1;
                isloading = true; //为真了
                $.ajax({
                    url:'<?php echo $this->createUrl('ajaxNewsList',array('openid'=>$openid)) ?>',
                    type : 'GET',
                    data:{
                        page:currentPage
                    },
                    dataType:'html',
                    beforeSend : function() {
                        $('#loading').show();
                        isloading = true;
                    },
                    success : function (data,response,status) {
                        if(data){
                            $('#min').append(data);
                            isloading = false;
                            $('#loading').hide();
                        }else{
                            isloading = true;
                            $('#loading').hide();
                            $('#alt').show();
                        }
                    }
                });
            }
        });
    });
</script>